<!DOCTYPE html>
<html lang="en">
	<head>
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
		<meta charset="utf-8" />
		<title>蝉阅读作者中心</title>
		<link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />
		
		<meta name="renderer" content="webkit" />
		<meta name="description" content="jeefast" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0" />

		<!-- bootstrap & fontawesome -->
		<link rel="stylesheet" href="assets/css/bootstrap.css" />
		<link rel="stylesheet" href="css/font-awesome.min.css">

		<!-- ace styles -->
		<link rel="stylesheet" href="assets/css/ace.css" />
		<link rel="stylesheet" href="assets/css/ace-rtl.css" />
		<link rel="stylesheet" href="css/login.css" />

	</head>

	<body class="login-layout light-login">
		<div class="main-container" id="jeefastapp" v-cloak>
			<div class="main-content">
				<div class="row">
					<div class="col-sm-10 col-sm-offset-1">
						<div class="login-container">
							<div class="center" id="logo">

								<!-- <h4 class="blue" id="id-company-text">&copy; Company Name</h4> -->
							</div>

							<div class="space-6"></div>

							<div class="position-relative">
								<div id="login-box" >
									<div class="widget-body">
										<div class="widget-main">
											<h4 class="header">
												作者中心
											</h4>

											<div class="space-6"></div>

											<form>
												<fieldset>
													<label class="block clearfix">
														<span class="block input-icon input-icon-right">
															<input type="text" class="form-control" v-model="username" placeholder="账号" />
															<i class="ace-icon fa fa-user"></i>
														</span>
													</label>

													<label class="block clearfix">
														<span class="block input-icon input-icon-right">
															<input type="password" class="form-control" v-model="password" placeholder="密码" />
															<i class="ace-icon fa fa-lock"></i>
														</span>
													</label>
													<div class="input-group input-group-sx">
														<!--<span class="input-group-addon">-->
															<!--&lt;!&ndash;<i class="fa fa-picture-o" style="width:15px;"></i>&ndash;&gt;-->
														<!--</span>-->
														<input type="text" class="form-control" style="width:165px;" v-model="captcha" @keyup.enter="login" placeholder="验证码">
												
														<span class="input-group-btn">
															<img :src="src" @click="refreshCode" height="34" style="width:95px;border: 1px solid #ccc;border-left: 1px;cursor: pointer;" />
														</span>
													</div>
													
													<div v-if="error" class="alert alert-danger alert-dismissible">{{errorMsg}}</div>
													<br>

													<!--<div class="space"></div>-->

													<div class="clearfix">
														<div class="rememberMe">
															<label class="inline">
																<input type="checkbox" class="ace" />
																<span class="lbl">记住密码</span>
															</label>
														</div>
														<div class="buttonContain">
															<button type="button" id="loginBtn"  @click="login">

																<span class="bigger-110">登录</span>
															</button>
														</div>

													</div>

													<div class="space-4"></div>
												</fieldset>
											</form>

										</div><!-- /.widget-main -->
										
										<!--<div class="toolbar clearfix">-->
						                  <!--<div style="float: right">-->
						                    <!--<a href="#"  class="forgot-password-link">语言<i class="ace-icon fa fa-arrow-right"></i>-->
						                      <!--<select id="locale" name="locale" style="padding:2px; width:80px;"> -->
							                      <!--<option value="">-&#45;&#45;请选择-&#45;&#45; </option> -->
							                      <!--<option value="en_US">English </option> -->
							                      <!--<option value="zh_CN" selected="selected">中文 </option>-->
						                      <!--</select>-->
						                    <!--</a>-->
						                  <!--</div>-->
						                <!--</div>-->
										
									</div><!-- /.widget-body -->
								</div><!-- /.login-box -->
								
							</div><!-- /.position-relative -->
							
							<!--<div class="center"><h4 class="blue" id="id-company-text">&copy; www.zhiyiyou.cn</h4></div>-->
							
							<!--<div class="navbar-fixed-top align-right">-->
								<!--<br />-->
								<!--&nbsp;-->
								<!--<a id="btn-login-dark" href="#">Dark</a>-->
								<!--&nbsp;-->
								<!--<span class="blue">/</span>-->
								<!--&nbsp;-->
								<!--<a id="btn-login-blur" href="#">Blur</a>-->
								<!--&nbsp;-->
								<!--<span class="blue">/</span>-->
								<!--&nbsp;-->
								<!--<a id="btn-login-light" href="#">Light</a>-->
								<!--&nbsp; &nbsp; &nbsp;-->
							<!--</div>-->
						</div>
					</div><!-- /.col -->
				</div><!-- /.row -->
			</div><!-- /.main-content -->
		</div><!-- /.main-container -->

		<!-- basic scripts -->
        <script src="libs/jquery.min.js"></script>
		<script type="text/javascript">
			if('ontouchstart' in document.documentElement) document.write("<script src='assets/js/jquery.mobile.custom.js'>"+"<"+"/script>");
		</script>

		<!-- inline scripts related to this page -->
		<script type="text/javascript">
			jQuery(function($) {
			 $(document).on('click', '.toolbar a[data-target]', function(e) {
				e.preventDefault();
				var target = $(this).data('target');
				$('.widget-box.visible').removeClass('visible');//hide others
				$(target).addClass('visible');//show target
			 });
			});
			
			//you don't need this, just used for changing background
			jQuery(function($) {
			 $('#btn-login-dark').on('click', function(e) {
				$('body').attr('class', 'login-layout');
				$('#id-text2').attr('class', 'white');
				$('#id-company-text').attr('class', 'blue');
				
				e.preventDefault();
			 });
			 $('#btn-login-light').on('click', function(e) {
				$('body').attr('class', 'login-layout light-login');
				$('#id-text2').attr('class', 'grey');
				$('#id-company-text').attr('class', 'blue');
				
				e.preventDefault();
			 });
			 $('#btn-login-blur').on('click', function(e) {
				$('body').attr('class', 'login-layout blur-login');
				$('#id-text2').attr('class', 'white');
				$('#id-company-text').attr('class', 'light-blue');
				
				e.preventDefault();
			 });
			 
			});
		</script>
				
		<script src="plugins/jqgrid/jquery.jqGrid.min.js"></script>
		<script src="libs/vue.min.js"></script>
		<script src="js/common.js"></script>
		<script type="text/javascript">
		var vm = new Vue({
			el:'#jeefastapp',
			data:{
				username: '',
				password: '',
		        captcha: '',
				error: false,
				errorMsg: '',
		        src: 'captcha.jpg'
			},
			beforeCreate: function(){
				if(self != top){
					top.location.href = self.location.href;
				}
			},
			methods: {
		        refreshCode: function(){
		            this.src = "captcha.jpg?t=" + $.now();
		        },
				login: function () {
		            var data = "username="+vm.username+"&password="+vm.password+"&captcha="+vm.captcha;
					$.ajax({
						type: "POST",
					    url: baseURL + "sys/login",
					    data: data,
					    dataType: "json",
					    success: function(r){
							if(r.code == 0){//登录成功
		                        localStorage.setItem("token", r.token);
		                        parent.location.href ='index.html';
							}else{
								vm.error = true;
								vm.errorMsg = r.msg;
							}
						}
					});
				}
			}
		});
		</script>
	</body>
</html>
